import os

from ament_index_python.packages import get_package_share_directory

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, SetEnvironmentVariable
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


def generate_launch_description():
    bringup_node_dir = get_package_share_directory('hnurm_bringup')
    params_file_bringup = LaunchConfiguration('bringup_params_file')
    return LaunchDescription([
        DeclareLaunchArgument(
            'bringup_params_file',
            default_value=os.path.join(bringup_node_dir, 'params', 'bringup.yaml'),
            description='bringup_params_file'
        ),
        Node(
            package='hnurm_bringup',
            executable='hnurm_bringup_node',
            output='screen',
            parameters=[params_file_bringup]
        ),
    ])
